package com.zhu.mpg.controller;

import com.zhu.mpg.common.PageVo;
import com.zhu.mpg.entity.Dept;
import com.zhu.mpg.entity.Employee;
import com.zhu.mpg.mapper.EmployeeMapper;
import com.zhu.mpg.service.DeptService;
import com.zhu.mpg.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author caoyunqi
 * @since 2021-03-17
 */
@RestController
@RequestMapping("emp")
public class EmployeeController {

    @Autowired
    EmployeeService service;
    @Autowired
    DeptService deptService;
    @PostMapping
    public PageVo<Employee> findEmpList(@RequestBody Map<String,String> map){
        return service.findEmpPage(map);
    }
    @RequestMapping("xiugai")
    public int xiugai(Employee employee){
        System.out.println(employee+"aasss");
       int xg=service.xiugai(employee);
        return xg;
    }
    @RequestMapping("shanchu")
    public String shanchu(String bh){
        System.out.println(bh);
       service.deleteById(Integer.parseInt(bh));
        return "1";
    }
}

